package a;

import java.util.Scanner;

public class FoueTwo{
public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n=sc.nextInt();
    Object[] obj=new Object[n];
    for(int i=0;i<n;i++)
    {
        String choose=sc.next();
        if(choose.equals('c')){
        	//obj[i] = new Computer();
        	continue;
        }
        else if(choose.equals('d')){
        	obj[i] = new Double(sc.nextDouble());continue;
        }
        else if(choose.equals('i')){
        	obj[i] = new Integer(sc.nextInt());continue;
        }
        else if(choose.equals('s')){
        	obj[i] = new String(sc.next());continue;
        }
        else {
        	obj[i] = null;continue;
        }
    }
    for(int i=obj.length-1;i>=0;i--)
    {
        if(obj[i]==null)continue;
        System.out.println(obj[i]);
    }
    sc.close();
}
}